###########################################
# Alternative exposure 1
###########################################

rm (list = ls())

library(Hmisc)
library(readstata13)
library(foreign)
library(lmtest)
library(sandwich)
library(stargazer)
library(msm)
library(ggplot2)
library(did)
library(lfe)
library(gridExtra)

# load data
load("before_coes_protests_riots_2024March1.RData")

##############
# Table A4
##############

mod_eviction_indiv = felm(support_eviction  ~ year2016 + year2017 + year2019 + year2020 + year2021 + year2022 + woman + age + education | year_f + comuna | 0 | idencuesta, data = d, keepCX = TRUE)
tab_eviction_indiv = mod_eviction_indiv
mod_eviction_indiv = tidy(mod_eviction_indiv,conf.int = TRUE)
mod_eviction_indiv

##############
# Table A5
##############

mod_students_indiv = felm(support_students  ~ year2016 + year2017 + year2019 + year2020 + year2021 + year2022 + woman + age + education | year_f + comuna | 0 | idencuesta, data = d, keepCX = TRUE)
tab_students_indiv = mod_students_indiv
mod_students_indiv = tidy(mod_students_indiv,conf.int = TRUE)
mod_students_indiv
